import 'package:anxin/pages/Index.dart';
import 'package:anxin/routers/application.dart';
import 'package:anxin/routers/routes.dart';
import 'package:flutter/material.dart';
import 'package:fluro/fluro.dart';
import 'package:provide/provide.dart';
import 'config/color.dart';
import 'config/string.dart';
import 'provide/CurrentIndexProvide.dart';

void main() {
  var currentIndexProvide = CurrentIndexProvide();
  var providers = Providers();
  providers.provide(Provider<CurrentIndexProvide>.value(currentIndexProvide));
  runApp(ProviderNode(child: MyApp(), providers: providers));
}



class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    final router = FluroRouter();
    Routes.configureRoutes(router);
    Application.router = router;

    return new Container(
      child:MaterialApp(
        title: KString.mainTitle,
        debugShowCheckedModeBanner: false,
        onGenerateRoute: Application.router.generator,
        theme: ThemeData(
          primaryColor: KColor.primaryColor
        ),
        home: Index(),
      )
    );

  }
}




